
// 签到奖励列表
// 签到按两周一个循环 每7天奖励最丰富 两周后重置
const loginSignInList = [ 
    {
        week: 1,
        list: [
            {
                day: 1,
                reward: [ // 奖励道具的id与数量
                    { id: 11, num: 1, name: '戴夫的礼物' },
                ], 
            },
            {
                day: 2,
                reward: [
                    { id: 18, num: 1, name: '阳光瓶' },
                ],
            },
            {
                day: 3,
                reward: [
                    { id: 2, num: 1, name: '银币' },
                ]
            },
            {
                day: 4,
                reward: [
                    { id: 18, num: 1, name: '阳光瓶' },
                ]
            },
            {
                day: 5,
                reward: [
                    { id: 11, num: 1, name: '戴夫的礼物' },
                ]
            },
            {
                day: 6,
                reward: [
                    { id: 18, num: 1, name: '阳光瓶' },
                ]
            },
            {
                day: 7,
                reward: [
                    { id: 19, num: 1, name: '阳光满屋图腾' },
                ]
            }
        ]
    },
    {
        week: 2,
        list: [
            {
                day: 1,
                reward: [
                    { id: 10, num: 1, name: '铲子礼盒' },
                ]
            },
            {
                day: 2,
                reward: [
                    { id: 18, num: 2, name: '阳光瓶' },
                ]
            },
            {
                day: 3,
                reward: [
                    { id: 2, num: 2, name: '银币' },
                ]
            },
            {
                day: 4,
                reward: [
                    { id: 11, num: 1, name: '戴夫的礼物' },
                ]
            },
            {
                day: 5,
                reward: [
                    { id: 11, num: 2, name: '戴夫的礼物' },
                ]
            },
            {
                day: 6,
                reward: [
                    { id: 10, num: 1, name: '铲子礼盒' },
                ]
            },
            {
                day: 7,
                reward: [
                    { id: 21, num: 1, name: '生命图腾' },
                    { id: 22, num: 1, name: '野性生长图腾' },
                    { id: 18, num: 5, name: '阳光瓶' },
                ]
            }
        ]
    }
]

const getTargetDateSignInReward = (signInTimes) => { // signInTimes 已签到的天数
    signInTimes = signInTimes + 1
    if (signInTimes > 14) signInTimes = signInTimes % 14
    let week = Math.ceil(signInTimes / 7)
    let day = signInTimes % 7 == 0 ? 7 : signInTimes % 7
    let reward = loginSignInList.find(i => i.week == week).list.find(i => i.day == day).reward
    return reward
}

export {
    loginSignInList,
    getTargetDateSignInReward,
}